DevOps on Google Cloud Platform: Covering Docker, Jenkins, Kubernetes by Srivastava Sachin
Author:Srivastava, Sachin [Srivastava, Sachin]
Language: eng
Format: epub
Publisher: UNKNOWN
Published: 2021-07-30T16:00:00+00:00
Creating a Continuous Delivery Project
With the Jenkins page up and running, we can finally create our CD pipeline. To try out our Jenkins feature, we create a very simple app, as follows:For trying the feature of Continuous Delivery in GCP we use the example code build by Google, this is a very simple page showing the information about the system because what we really need is understand only how to create the environment, the project is based on the gceme image present in the Google repository, gcr.io/cloud-solutions-images/gceme
For creating a CD pipeline, we first must create the different environment we use to release the software. We actually create three environments.
⢠Production : This is the environment in which we release the software for production.⢠Services : We use the service environment to describe how many layers we have. In our case, we have a back end and front end. This is not an environment like production or canary, but it is something we can use to have a more logical division of our service layers. This allows better management of that.
⢠Canary : This creates the canary server used for the system. Note A canary server is a server used in CD to test a feature in a real environment before it is released for production. A canary server emulates the production environment, only in a limited manner. The canary server can be used to isolate errors in code and, normally, for a limited number of users selected for production purposes. Using these servers is useful not only to uncover errors but to test the UI/UX of the application.
These environments are used to simulate the phases of CD pipeline development. To simulate them, we first must create a new namespace in Kubernetes.
kubectl create ns practical-gcp-production This command creates a new namespace in the Kubernetes cluster. We use this namespace to build our production environment. With the new namespace created, we can now create the services necessary for the code. The first service we create is for the production. The production has two services: back end and front end (see Listing 5-11 ).
Listing 5-11. Kubernetes File for Creating the Back-End Service in the Production Namespace kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: practical-gcp-backend-production
spec:
replicas: 1
template:
metadata:
name: backend
labels:
app: gceme
role: backend
env: production
spec:
containers:
- name: backend
image: gcr.io/cloud-solutions-images/gceme:1.0.0 resources:
limits:
memory: "500Mi"
cpu: "100m"
imagePullPolicy: Always
readinessProbe:
httpGet:
path: /healthz
port: 8080
command: ["sh", "-c", "app -port=8080"]
ports:
- name: backend
containerPort: 8080
The preceding is the Kubernetes file for creating the back-end service for the production. Now we can see that the service uses the applicationgceme, version 1.0.0.containers:
- name: backend
image: gcr.io/cloud-solutions-images/gceme:1.0.0
resources:
limits:
memory: "500Mi"
cpu: "100m"
imagePullPolicy: Always
The image is pulled from the Google repository and built in the Kubernetes file. The other service we need to create is the front-end service (Listing 5-12 ).
Listing 5-12. Front-End Production Service kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: practical-gcp-frontend-production
spec:
replicas:
template:
metadata:
name: frontend
labels:
app: gceme
role: frontend
env: production
spec:
containers:
- name: frontend
image: gcr.io/cloud-solutions-images/gceme:1.0.0
resources:
limits:
memory: "500Mi"
cpu: "100m"
imagePullPolicy: Always
readinessProbe:
httpGet:
path: /healthz
port: 80
command: ["sh", "-c", "app -frontend=true -backend-service=http:// gceme-backend:8080 -port=80"]
ports:
- name: frontend
containerPort: 80
These files are in the same folder, and we can use them for a deployment. A deployment is used to create and set a specific state for a pod and ReplicaSet.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7808)
Grails in Action by Glen Smith Peter Ledbrook(7719)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6807)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6803)
Running Windows Containers on AWS by Marcio Morales(6323)
Kotlin in Action by Dmitry Jemerov(5089)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(5051)
Combating Crime on the Dark Web by Nearchos Nearchou(4623)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4575)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4437)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4314)
The Age of Surveillance Capitalism by Shoshana Zuboff(3977)
Python for Security and Networking - Third Edition by José Manuel Ortega(3875)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3534)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3528)
Learn Wireshark by Lisa Bock(3491)
Mastering Python for Networking and Security by José Manuel Ortega(3376)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3353)
Blockchain Basics by Daniel Drescher(3322)
